home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / rebuildCurveSetup.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  4.1 KB  |  101 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. //  Alias|Wavefront Script File
  19. //  MODIFY THIS AT YOUR OWN RISK
  20. //
  21. //  Creation Date:  7 Oct 1998
  22. //  Author:         mgr
  23. //
  24. //  Procedure Name:
  25. //      rebuildCurveSetup
  26. //
  27. //  Description:
  28. //        Update the state of the option box UI to reflect the option values.
  29. //
  30. //  Input Arguments:
  31. //      parent               - Top level parent layout of the option box UI.
  32. //                             Required so that UI object names can be 
  33. //                             successfully resolved.
  34. //
  35. //        forceFactorySettings - Whether the option values should be set to
  36. //                             default values.
  37. //
  38. //  Return Value:
  39. //      None.
  40. //
  41.  
  42. global proc rebuildCurveSetup(string $parent, int $forceFactorySettings)
  43. {
  44.     setParent $parent;
  45.  
  46.     // Query the optionVar's and set the values into the controls
  47.     //
  48.     int $rebuildType = `optionVar -query rebuildCurveType` + 1;
  49.     int $numSpans = `optionVar -query rebuildCurveTypeUniformNumSpans`;
  50.     int $degree = `optionVar -query rebuildCurveTypeUniformDegree`;
  51.     int $keepRange = `optionVar -query rebuildCurveKeepRange`;
  52.     int $endKnots = `optionVar -q rebuildCurveEndKnots`;
  53.     int $keepControlPoints = `optionVar -query rebuildCurveKeepControlPoints`;
  54.     int $keepEndPts = `optionVar -query rebuildCurveKeepEndPoints`;
  55.     int $keepTan = `optionVar -query rebuildCurveKeepEndTangents`;
  56.     int $keepNumSpans = `optionVar -query rebuildCurveKeepNumSpans`;
  57.     int $useGlobalTol = `optionVar -query rebuildCurveUseGlobalTolerance`;
  58.     radioButtonGrp -e -select (2 - $useGlobalTol) toleranceRadioButtonGrp;
  59.  
  60.     float $localTol = `optionVar -query rebuildCurveLocalTolerance`;
  61.     int $keepOriginal = `optionVar -query rebuildCurveKeepOriginal`;
  62.  
  63.     // Set the controls
  64.     //
  65.     if( $rebuildType == 1 || $rebuildType == 2 || $rebuildType == 3 )
  66.         radioButtonGrp -edit -select $rebuildType rebuildTypeRadioGroup1;
  67.     else if( $rebuildType == 4 || $rebuildType == 5 ) {
  68.         int $temp = $rebuildType - 3;
  69.         radioButtonGrp -edit -select $temp rebuildTypeRadioGroup2;
  70.     } else {
  71.         int $temp = $rebuildType - 5;
  72.         radioButtonGrp -e -select $temp rebuildTypeRadioGroup3;
  73.     }
  74.     intSliderGrp -edit -value $numSpans numSpansIntSliderGrp;
  75.  
  76.     switch($degree) {
  77.         case 1: radioButtonGrp -e -select 1 rebuildCrvDegree123; break;
  78.         case 2: radioButtonGrp -e -select 2 rebuildCrvDegree123; break;
  79.         case 3: radioButtonGrp -e -select 3 rebuildCrvDegree123; break;
  80.         case 5: radioButtonGrp -e -select 1 rebuildCrvDegree57; break;
  81.         case 7: radioButtonGrp -e -select 2 rebuildCrvDegree57; break;
  82.         default: radioButtonGrp -e -select 3 rebuildCrvDegree123; break;
  83.     }
  84.  
  85.     radioButtonGrp -e -select ($endKnots+1) endKnotsRadioButtonGrp;
  86.     radioButtonGrp -edit -select ($keepRange+1) keepRangeRadioButtonGrp;
  87.     checkBoxGrp -edit -value1 $keepEndPts keepCheckBoxGrp;
  88.     checkBoxGrp -edit -value2 $keepTan keepCheckBoxGrp;
  89.     checkBoxGrp -edit -value3 $keepControlPoints keepCheckBoxGrp;
  90.     checkBoxGrp -edit -value4 $keepNumSpans keepCheckBoxGrp;
  91.     radioButtonGrp -edit -select $useGlobalTol toleranceRadioButtonGrp;
  92.     floatSliderGrp -edit -value $localTol localTolFloatFieldGrp;
  93.  
  94.     if( `checkBoxGrp -q -exists keepOriginalCheckBox` ) {
  95.         checkBoxGrp -edit -value1 $keepOriginal keepOriginalCheckBox;
  96.     }
  97.  
  98.     rebuildCurveVisibility $parent -1 $rebuildType $keepControlPoints 
  99.         $keepNumSpans;
  100. }
  101.